﻿/*
 * Created by SharpDevelop.
 * User: issuser
 * Date: 2011-1-10
 * Time: 18:11
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using NLite.Validation;

namespace NLite.Domain
{
	 public class DomainException : Exception
    {
        public IErrorState ValidationError { get; private set; }

        public DomainException()
        {
            ValidationError = new ErrorState();
        }
        
        public DomainException(string errorKey, string entityId)
        {
         	ValidationError = new ErrorState();
         	ValidationError.AddError(errorKey,entityId);
        }
       
    }
    public class EntityNotExistException : DomainException
    {
        public EntityNotExistException(string errorKey, string entityId)
            : base(errorKey, entityId)
        {
        }
    }
    public class DeleteEntityFailedException : DomainException
    {
        public DeleteEntityFailedException(string errorKey, string entityId)
            : base(errorKey, entityId)
        {
        }
    }
    public class DuplicatedNameException : DomainException
    {
        public DuplicatedNameException(string errorKey, string name)
            : base(errorKey, name)
        {
        }
    }
    public class BatchDeleteEntityFailedException : DomainException
    {
        public BatchDeleteEntityFailedException(string errorKey, string failedCount)
            : base(errorKey, failedCount)
        {
        }
    }
    public class QueryException:DomainException
    {
    	
    }
    public class PersistenceException:DomainException
    {
    	
    }
      
}
